# include "logSystem.h"

static LogLevel systemLogLevel = NONE;

void initLogSystem (LogLevel maxLevel) {
	systemLogLevel = maxLevel;
}

void logMessage (char *l, char *file, char *fct, char *msg, LogLevel lvl) {
	// tratar erros criticos!
	switch (lvl) {
		case INFO:
			fprintf(stderr,"INFO :\n");
			break;
		case WARNING:
			fprintf(stderr,"WARNING :\n");
			break;
		case ERRO:
			fprintf(stderr,"ERROR :\n");
			break;
		case CRITICAL:
			fprintf(stderr,"CRITICAL ERROR!! :\n");
			break;
	}
	fprintf(stderr,"\tFolder: %s\n",l);
	fprintf(stderr,"\tFile: %s\n",file);
	fprintf(stderr,"\tFunction: %s\n",fct);
	fprintf(stderr,"\tMessage: %s\n",msg);
	if (lvl == CRITICAL) exit(EXIT_FAILURE);
}
